#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>

int lengthOfLastWord(char* s) 
{
    int ret = 0;
    for (int len = strlen(s) - 1; len >= 0; len--)
    {
        if (s[len] == ' ')
        {
            if (ret > 0)
                break;
            continue;
        }
        ret++;
    }
    return ret;
}

int main()
{
    char ch[100] = "\0";
    gets(ch);
    int ret = lengthOfLastWord(ch);
    printf("%d\n", ret);
    return 0;
}